/*
 * @Descripttion: 
 * @version: 
 * @Author: TT
 * @Date: 2023-10-28 10:54:31
 * @LastEditors: TT
 * @LastEditTime: 2023-10-28 15:29:06
 */

import 'package:flutter/material.dart';
import 'package:hzy_project_template/models/image_normal_model.dart';
import 'package:hzy_project_template/models/models_index.dart';

import '../models/tu_chong_model.dart';

class TuChongUtils {
  static configDetailImageModelList({
    required TuChongItem tuChongItem,
    double? width,
  }) {
    List<ImageNormalModel> list = List<ImageNormalModel>.from(
      tuChongItem.images!.map(
        (e) => ImageNormalModel(
          url: e.imageUrl,
          heroStr: e.imageUrl,
          size: Size(
            width ?? 0,
            (width ?? 0) / ((e.width ?? 0) / (e.height ?? 1)),
          ),
        ),
      ),
    );

    return list;
  }
}
